package cz.najman.emdroid.mappings;

import java.util.HashMap;

import android.net.Uri;
import android.provider.BaseColumns;
import cz.najman.emdroid.provider.EMDroidDataProvider;
import cz.najman.emdroid.provider.Flags;

public class PaymentInformation extends Mappings implements BaseColumns, Flags {
	
	public static final String URI_STRING_PAYMENT_INFORMATIONS = "content://" + EMDroidDataProvider.AUTHORITY + "/paymentInformations";

	public static final Uri CONTENT_URI_PAYMENT_INFORMATIONS = Uri.parse(URI_STRING_PAYMENT_INFORMATIONS);
		
	
	
	/**
	 * Content type dir
	 */
	public static final String CONTENT_TYPE_DIR = "vnd.android.cursor.dir/vnd.mitch.paymentInformation";
	/**
	 * Content type item
	 */
	public static final String CONTENT_TYPE_ITEM = "vnd.android.cursor.item/vnd.mitch.paymentInformation";
	
	// DB
	public static final String TABLE_NAME = "payment_informations";
	
	/**
	 * Unique id for the PaymentInformation
	 */
	//public static final String _ID = "pay_inf__id";
	
	/** 
	 * Type of the Payment information.
	 * Possible options are VALUE_TYPE_STORNO or 
	 * VALUE_TYPE_PAYMENT.
	 */
	public static final String VALUE_TYPE = "value_type";
	
	/**
	 * Date form which the Payment information is active.
	 */
	public static final String ACTIVE_FROM = "active_from";
	
	/**
	 * Date to which the Payment information is active.
	 */
	public static final String ACTIVE_TO = "active_to";
	
	/**
	 * Amount of money of the payment value
	 */
	public static final String VALUE = "value";
	
	/**
	 * Indicates that the Payment informations is payment value
	 */
	public static final char VALUE_TYPE_STORNO = 'S';
	
	/**
	 * Indicates that the Payment informations is storno value
	 */
	public static final char VALUE_TYPE_PAYMENT = 'P';
	
	public static final String EVENT_ID = "event_id";
	
	
	public static final int INDEX_ID = 0;
	
	public static final int INDEX_VALUE_TYPE = 1;
	
	public static final int INDEX_ACTIVE_FROM = 2;
	
	public static final int INDEX_ACTIVE_TO = 3;
	
	public static final int INDEX_VALUE = 4;
	
	public static final int INDEX_EVENT_ID = 5;
	
	public static final int OBJECT_ID = 2;
	
	/* MAPPING KEYS */	
	private static final String M_KEY_START_TAG = "paymentInformation";
	private static final String M_KEY_ID = "id";
	private static final String M_KEY_VALUE_TYPE = "valueType";
	private static final String M_KEY_VALUE = "value";
	private static final String M_KEY_ACTIVE_FROM = "activeFrom";
	private static final String M_KEY_ACTIVE_TO = "activeTo";
	private static final String M_KEY_EVENT_ID = "eventId";	
		
	public PaymentInformation() {
		mToDbMappings = new HashMap<String, String>();
		mFromDbMappings = new HashMap<String, String>();
		
		mToDbMappings.put(M_KEY_START_TAG, START_TAG);
		mToDbMappings.put(M_KEY_ID, _ID);
		mToDbMappings.put(M_KEY_VALUE_TYPE, VALUE_TYPE);
		mToDbMappings.put(M_KEY_VALUE, VALUE);
		mToDbMappings.put(M_KEY_ACTIVE_FROM, ACTIVE_FROM);
		mToDbMappings.put(M_KEY_ACTIVE_TO, ACTIVE_TO);
		mToDbMappings.put(M_KEY_EVENT_ID, EVENT_ID);
		
		mDates.add(ACTIVE_FROM);
		mDates.add(ACTIVE_TO);
	}
	
}
